#region MIT Licence
/*
 * Copyright (C) 2014 PdfCreative
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
 * and associated documentation files (the "Software"), to deal in the Software without restriction, 
 * including without limitation the rights to use, copy, modify, merge, publish, distribute, 
 * sublicense, and/or sell copies of the Software, and to permit persons to whom 
 * the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included 
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 
 * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
#endregion

using System;
using System.Collections.Generic;
using System.Text;

using PdfCreative.Pdf.Writer;

namespace PdfCreative.Pdf.Graphics
{
    /// <summary>
    /// The Brush class is the abstract base class for all brushes. To use a regular brush, create an
    /// instance of SolidBrush. For gradient brushes use LinearGradientBrush or RadialGradiantBrush.
    /// </summary>
    public abstract class Brush
    {
        // Public methods
        // ==============
        #region Public methods
        /// <summary>
        /// Clones this brush instance.
        /// </summary>
        /// <returns>The clone.</returns>
        public abstract Brush Clone();
        #endregion



        // Internal protected properties
        // =============================
        #region Internal protected properties
        /// <summary>
        /// Indicates if this brush requires a resource be created for it.
        /// </summary>
        internal protected abstract bool RequiresResource { get; }
        #endregion



        // Internal protected methods
        // ==========================
        #region Internal protected methods
        /// <summary>
        /// Writes the changes between this brush and another brush to the specified PDF writer.
        /// </summary>
        /// <param name="writer">The writer to write to</param>
        /// <param name="otherBrush">The other brush to compare this one to.</param>
        internal protected abstract void WriteChanges(PdfWriter writer, Brush otherBrush);

        /// <summary>
        /// Writes the resource brush to the specified PDF writer.
        /// </summary>
        /// <param name="writer">The PDF writer to write to.</param>
        /// <param name="resource">The resource reference to write.</param>
        protected internal virtual void WriteResource(PdfWriter writer, PdfResourceReference resource) { }

        #endregion

    } // Brush class
}
